/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    overflow: hidden;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--deepseek-primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* 语音播放浮窗 */
.voice-popup {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    width: 260px;
    height: 180px;
    border: 1px solid var(--deepseek-border);
    animation: fadeIn 0.3s ease-in-out;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.voice-popup:not(.initializing) {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.voice-animation {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--deepseek-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    color: white;
    cursor: pointer;
    animation: pulse 2s infinite;
}

.voice-animation.paused {
    animation-play-state: paused;
    background-color: var(--deepseek-secondary-text);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(41, 112, 255, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(41, 112, 255, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(41, 112, 255, 0);
    }
}

.voice-text {
    font-size: 14px;
    color: var(--deepseek-text);
    margin-bottom: 5px;
}

.voice-status {
    font-size: 12px;
    color: var(--deepseek-secondary-text);
    text-align: center;
    width: 100%;
    height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    margin-top: 5px;
}

.voice-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--deepseek-secondary-text);
    font-size: 16px;
    padding: 2px;
}

.voice-close-btn:hover {
    color: var(--danger-color);
} 